flowchart TB
    classDef default fill:transparent, color:#000;
    classDef hook-parallel fill:#ffb3b3,stroke:#000;
    classDef hook-sequential fill:#ffd2b3,stroke:#000;
    classDef hook-first fill:#fff2b3,stroke:#000;
    classDef hook-sequential-sync fill:#ffd2b3,stroke:#f00;
    classDef hook-first-sync fill:#fff2b3,stroke:#f00;

    augmentchunkhash("augmentChunkHash"):::hook-sequential-sync
    click augmentchunkhash "/guide/en/#augmentchunkhash" _parent

	banner("banner"):::hook-sequential
	click banner "/guide/en/#banner" _parent

	closebundle("closeBundle"):::hook-parallel
	click closebundle "/guide/en/#closebundle" _parent

	footer("footer"):::hook-sequential
	click footer "/guide/en/#footer" _parent

	generatebundle("generateBundle"):::hook-sequential
	click generatebundle "/guide/en/#generatebundle" _parent

	intro("intro"):::hook-sequential
	click intro "/guide/en/#intro" _parent

	outputoptions("outputOptions"):::hook-sequential-sync
	click outputoptions "/guide/en/#outputoptions" _parent

	outro("outro"):::hook-sequential
	click outro "/guide/en/#outro" _parent

	renderchunk("renderChunk"):::hook-sequential
	click renderchunk "/guide/en/#renderchunk" _parent

	renderdynamicimport("renderDynamicImport"):::hook-first-sync
	click renderdynamicimport "/guide/en/#renderdynamicimport" _parent

	rendererror("renderError"):::hook-parallel
	click rendererror "/guide/en/#rendererror" _parent

	renderstart("renderStart"):::hook-parallel
	click renderstart "/guide/en/#renderstart" _parent

	resolvefileurl("resolveFileUrl"):::hook-first-sync
	click resolvefileurl "/guide/en/#resolvefileurl" _parent

	resolveimportmeta("resolveImportMeta"):::hook-first-sync
	click resolveimportmeta "/guide/en/#resolveimportmeta" _parent

	writebundle("writeBundle"):::hook-parallel
	click writebundle "/guide/en/#writebundle" _parent


	outputoptions
	--> renderstart
	--> |each chunk|beforerenderdynamicimport

	afteraddons
	--> |each chunk|renderchunk

	augmentchunkhash
	--> generatebundle
	--> writebundle
	.-> closebundle

	subgraph generateChunks [" "]
	    direction TB
	    beforerenderdynamicimport(( ))
        ---> beforeresolveimportmeta(( ))
        ----> beforereaddons(( ))
        --> banner & footer & intro & outro
        --> afteraddons(( ))
        .-> |next chunk|beforerenderdynamicimport

	    beforerenderdynamicimport
        --> |"each import()"|renderdynamicimport
        --> beforerenderdynamicimport

    	beforeresolveimportmeta
    	--> |each import.meta.*|beforeimportmeta(( ))
    	--> |import.meta.url|resolvefileurl
    	--> afterresolveimportmeta(( ))

	    beforeimportmeta
	    --> |other|resolveimportmeta
	    --> afterresolveimportmeta

	    afterresolveimportmeta
	    --> beforeresolveimportmeta
	end

	renderchunk
    --> augmentchunkhash
    .-> |next chunk|renderchunk

	style generateChunks stroke-width:0px;

	rendererror
	.-> closebundle
